<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>重大项目节点管理系统-登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <!-- 基础css -->
    <link rel="stylesheet" href="<s:url value="/assets/web/css/base.css"></s:url>">
    <!-- 动画样式 -->
    <%--<link href="<s:url value="/assets/web/css/login/animate.css"></s:url>" rel="stylesheet">--%>
    <!-- 登录css -->
    <link rel="stylesheet" href="<s:url value="/assets/web/css/login/login.css"></s:url>">
    
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body id="section">
    <div class="middle-box text-center   animated fadeInDown">
           <div class="middle-content">
                <p>登录</p>
                <form id="from1" method="post"  action="<s:url value="/newlogin/gologin"></s:url>">
                    <div class="form-group">
                        <input type="text" class="form-control userName" id="username" name="username" placeholder="请输入账号" onfocus="userBlur()">
                    </div>
                    <div class="form-group">
                        <input type="password" id="password"  name="password" class="form-control passWord" placeholder="请输入密码" onfocus="pasBlur()">
                    </div>
                    <button class="btn btn-primary block  m-b" onclick="login()">确认登陆</button>
                </form>
                <div class="zd">
                    重大项目节点管理系统
                 </div>
                <span class="username-error" style="display: block;"></span>
               <span class="password-error" style="display: block;"></span>
           </div>
    </div>
  <!--   <footer>
        <div>厦门公司名字</div>
        <div>注册号</div>
    </footer> -->
    
    <script src="<s:url value="/assets/web/js/jquery.min.js"></s:url>"></script>
    <script>
    $(function() {
    	 var mgs="${mgs}";
    	if(mgs!=""){
    		$(".username-error").html(mgs).show()
    	} 

    });

         //判断是否为ie浏览器  不是就执行动画 否则不执行
        function isIE() { //ie?
            if (!!window.ActiveXObject || "ActiveXObject" in window) {
                console.log("是");
            }
            else {
                console.log("否");
                var section = $('#section');
                var x =0;
                function polling() {
                    x += 15;
                    section.animate({
                        'background-position-x': x+'px',
                    }, 400, 'linear');
                    setTimeout(polling,200)
                }
                polling();
            }
        }
        isIE();

       
        function login(){
        	var username=$("#username").val();
        	var password=$("#password").val();
        	if(username==""){
                $(".username-error").html("账号不能为空").show();
        		return false;
        	}
        	if(password==""){
                $(".password-error").html("密码不能为空").show();
        		return false;
        	}
        	$("#from1").submit();
        }

        function userBlur() {
            $(".username-error").html("");
        }

        function pasBlur() {
            $(".password-error").html("");
        }
    </script>
    
     
</body>